package com.xyjf.prod.tools.prod_tools.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.xyjf.prod.tools.prod_tools.entity.sjd.MlptBanner;

import com.xyjf.prod.tools.prod_tools.mapper.oracle.MlptBannerMapper;
import com.xyjf.prod.tools.prod_tools.page.EasyUiPage;
import com.xyjf.prod.tools.prod_tools.service.IMlptBannnerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class MlptBannerServiceImpl implements IMlptBannnerService {

    @Autowired
    private MlptBannerMapper mlptBannerMapper;


    @Override
    public EasyUiPage getPage(Map<String, Object> map) {
        int page=Integer.parseInt(map.get("page").toString());
        int rows=Integer.parseInt(map.get("rows").toString());
        PageHelper.startPage(page, rows);
        List<MlptBanner> list=mlptBannerMapper.getPage(map);
        PageInfo<MlptBanner> pageInfo = new PageInfo<MlptBanner>(list);
        Long total = pageInfo.getTotal();
        EasyUiPage uiPage=new EasyUiPage();
        uiPage.setTotal(total);
        uiPage.setRows(list);
        return uiPage;
    }
}
